﻿using System.Windows.Input;

namespace Notoric.ViewModel
{
    /// <summary>
    /// Defines <see cref="RoutedCommand"/>s that manipulates <see cref="IProjectExplorerItem"/>s.
    /// </summary>
    public static class ProjectExplorerCommands
    {
        /// <summary>
        /// Gets the command that closes an <see cref="IProjectExplorerItem"/>.
        /// </summary>
        public static readonly RoutedCommand CloseCommand = new RoutedCommand();

        /// <summary>
        /// Gets the command that deletes an <see cref="IProjectExplorerItem"/>.
        /// </summary>
        public static readonly RoutedCommand DeleteCommand = new RoutedCommand();

        /// <summary>
        /// Gets the command that opens the metadata sheet associated with a <see cref="IProjectExplorerItem"/>.
        /// </summary>
        public static readonly RoutedCommand EditMetadataCommand = new RoutedCommand();

        /// <summary>
        /// Gets the command that creates a new <see cref="Elements.Composition"/>.
        /// </summary>
        public static readonly RoutedCommand NewCompositionCommand = new RoutedCommand();

        /// <summary>
        /// Gets the command that creates a new <see cref="Directory"/>.
        /// </summary>
        public static readonly RoutedCommand NewDirectoryCommand = new RoutedCommand();

        /// <summary>
        /// Gets the command that creates a new <see cref="Elements.Page"/>.
        /// </summary>
        public static readonly RoutedCommand NewPageCommand = new RoutedCommand();

        /// <summary>
        /// Gets the command that creates a new <see cref="Elements.Resource"/>.
        /// </summary>
        public static readonly RoutedCommand NewResourceCommand = new RoutedCommand();

        /// <summary>
        /// Gets the command that creates a new <see cref="Elements.Score"/>.
        /// </summary>
        public static readonly RoutedCommand NewScoreCommand = new RoutedCommand();

        /// <summary>
        /// Gets the command that opens an <see cref="IProjectExplorerItem"/>.
        /// </summary>
        public static readonly RoutedCommand OpenCommand = new RoutedCommand();

        /// <summary>
        /// Gets the command that renames a <see cref="IProjectExplorerItem"/>.
        /// </summary>
        public static readonly RoutedCommand RenameCommand = new RoutedCommand();

        static ProjectExplorerCommands()
        {
            DeleteCommand.InputGestures.Add(new KeyGesture(Key.Delete));
            OpenCommand.InputGestures.Add(new KeyGesture(Key.Enter, ModifierKeys.None, "Enter"));
            RenameCommand.InputGestures.Add(new KeyGesture(Key.F2));
        }
    }
}
